import React,{ useContext } from 'react'
import { ColorContext,UPDATE_COLOR } from './color'
 
function Btn() {
    const { dispatch } = useContext(ColorContext)
    return (<div>
        <button onClick={()=>{ dispatch({color:"blue",type:UPDATE_COLOR}) }} > blue </button>
        <button onClick={()=>{ dispatch({color:"red",type:UPDATE_COLOR}) }} > red </button>
    </div>)
}
export default Btn